package src.main.BehavioralPatterns.Observer;

// 具体观察者，当前状况显示屏
public class CurrentConditionsDisplay implements Observer {
    private float temperature;
    private float humidity;

    // 观察者接收到更新后的处理逻辑
    @Override
    public void update(float temperature, float humidity, float pressure) {
        // 更新自己的状态
        this.temperature = temperature;
        this.humidity = humidity;
    }

    // 具体观察者特有的显示功能
    public void display() {
        System.out.printf("[当前状况] %.1f°C | 湿度 %.1f%%\n", temperature, humidity);
    }
}
